package com.brayan.melinxa.gui;

import java.awt.EventQueue;

import com.brayan.melinxa.Melinxa;
import com.brayan.melinxa.gui.systemtray.Tray;
import com.brayan.melinxa.gui.windows.MainWindow;

/**
 * The GUI Startup class which invokes the Melinxa application and adds a window
 * frame and a traybar icon.
 * 
 * @author Brayan Zimmerli
 */
public class MelinxaGUI {

	/**
	 * The Melinxa mirror library doesn't need any GUI. You may start it with on
	 * its own. For a GUI startup, use this class.
	 * 
	 * @param Provide
	 *            the source directory to observe and the destination directory
	 *            where to copy/shadow the observed directory content.
	 */
	public static void main(String[] args) {
		MelinxaGUI melinxaGUI = new MelinxaGUI(args);
	}

	public MelinxaGUI(final String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				Melinxa melinxa = new Melinxa();

				// Invoke (but hide) the window application.
				MainWindow window = new MainWindow(melinxa);

				// Start the system tray.
				Tray tray = new Tray(melinxa, window);
			}
		});
	}
}
